# 先安装 xgboost

from xgboost.sklearn import XGBClassifier
from sklearn.datasets import load_iris
# from xgboost.sklearn import XGBRegressor
iris = load_iris()
X = iris.data
y = iris.target
XGB = XGBClassifier()
XGB.fit(X, y)

print(XGB.feature_importances_)

print(XGB.predict_proba(X[:5]))
print(XGB.predict(X[:5]))